The invention pertains to machine vision and, more particularly, to methods and apparatus for comparing patterns and images. The invention has application, for example, in quality control and in the automated inspection of parts under assembly.
Machine vision refers to the automated analysis of images to determine characteristics of objects shown in them. It is often employed in automated manufacturing lines, where images of components are analyzed to determine placement and alignment prior to assembly. Machine vision is also used for quality assurance. For example, in the semiconductor device industry, images of chips are analyzed to insure that leads, solder paste and other components do not overrun designated boundaries.
Central to many machine vision applications is the comparison of patterns and images. To xe2x80x9creadxe2x80x9d a product label, for example, a machine vision system must compare each symbol in an image of the label against patterns representing all possible letters and numbers. Likewise, to determine whether a particular part is present on a conveyor belt, a machine vision system must compare each object from an image of that belt against a pattern representing the sought-after part.
A common machine vision technique for comparing a pattern and an image is golden template comparison, or GTC. This involves aligning the patternxe2x80x94here, referred to as a xe2x80x9ctemplatexe2x80x9dxe2x80x94with the image and subtracting the two. The result can be used to determine if an object represented by the template is present in the image at the alignment location. For example, in semiconductor die inspection, GTC can be used to subtract a template representing a model die from a runtime image of a die under assembly. If the latter is properly formed, the resultant image or pixel array is blank (e.g., all black or white). On the other hand, if there are defects in the die under assembly, e.g., adhesive blotches, these will appear as patterns in the resultant image or array.
As parts under inspection become smaller, manufacturing tolerances more exacting, and manufacturing lines faster, GTC and other comparison techniques are continually pressed to provide results to sub-pixel levels of accuracy. This is problematic at the boundaries of the objects being inspected, since the image data along edges is often unreliable. Though GTC remains a mainstay of machine vision, there is a need for still better image comparison tools. An object of this invention is to provide such tools.
A more particular object of this invention is to provide improved methods and systems for comparing a pattern to an image. A still more particular object of the invention is to provide such methods and systems that are accurate along boundaries of objects contained in the pattern or image.
Another object of the invention is to provide such methods and systems as facilitate quantitative and qualitative analysis of the similarities and differences between a compared pattern and image.
Still yet another object of the invention is to provide such methods and systems as are amenable to use withing existing machine vision apparatus and which operate without undue consumption of resources.
The foregoing are among the objects attained by the invention, which provides boundary-based machine vision methods and systems for comparing a pattern to an image. Such a method, according to one aspect of the invention, includes the steps finding points on a boundary in the image and identifying one or more boundary features, at least one of which is made up of multiple such points. The method further includes determining point-by-point relationships, if any, between each point defining the boundary feature in the image and points on a boundary in the pattern. A relationship between the boundary feature in the image and the pattern (e.g., whether the boundary feature in the image matches a corresponding feature in the pattern) is then determined as a function of the point-by-point relationships.
According to further aspects of the invention, the point-by-point relationships are identified as xe2x80x9cmatches,xe2x80x9d i.e., boundary points in the image that match boundary points in the pattern, xe2x80x9cextras,xe2x80x9d i.e., boundary points in the image which do not match boundary points in the pattern, and xe2x80x9cmissing,xe2x80x9d i.e., boundary points in the pattern that do not match boundary points in the image.
In related aspects, the invention provides methods as described above in which boundary points in the image and pattern are deemed to xe2x80x9ccorrespondxe2x80x9d to one another if they reside at substantially the same locations, e.g., if the distance between their respective coordinate locations is within a selected range. Such points are deemed to xe2x80x9cmatchxe2x80x9d if, in addition, they lie at substantially the same angles with respect to their respective neighbors (e.g., the difference between their respective angles is within a selected range) and if they are of substantially the same contrasts (e.g., the difference between their respective contrasts is within a selected range).
In another aspect, the invention provides methods as described above including generating quantitative and/or qualitative information about matching, extra or missing points. This includes the determining the distance between each boundary point in the image and the corresponding boundary point in the pattern. It can also include determining the differences between the directions of those points and/or the differences in their contrasts.
According to still further aspects of the invention, image boundary features are determined to be xe2x80x9cmatchingxe2x80x9d if, for example, the majority of points making up the feature match boundary points in the pattern. Alternatively, or in addition, a boundary feature in the image can be marked as matching if an average, or other statistical measure, of location, angle and/or contrast differences between the points making up that feature and the corresponding points in the pattern fall within selected ranges.
According to related aspects of the invention, an image boundary feature can be marked or identified as xe2x80x9cextraxe2x80x9d if the majority of its boundary points do not match points in the pattern and/or if an average (or other statistical measure) of location, angle and/or contrast differences between the points making up that feature and corresponding points in the pattern fall outside a selected range. A feature can be likewise be identified as xe2x80x9cmissingxe2x80x9d if the majority of points that define it in the pattern do not match points in the image boundary and/or if an average (or other statistical measure) of differences between the points making up that feature in the pattern and corresponding points in the image fall outside a selected range.
In another aspect, the invention provides a method as described above including generating quantitative and/or qualitative information about the matching, extra or missing features. This can also include counting the number of matching points that make up each feature and/or, by way of further example, determining the minimum and maximum distances between the points that make up that feature and the corresponding points that make up the corresponding feature in the pattern. Quantitative information can also include, in the case of features identified as extra, their lengths, and/or their degree of linearity. In addition to, or in lieu of, such quantitative information, the information can include a qualitative characterization of the similarity of each matching point or feature (e.g., xe2x80x9cgood,xe2x80x9d xe2x80x9cbad,xe2x80x9d etc.)
Still further aspects of the invention provide machine vision systems operating in accord with the methods described above.